package com.example.demo.init;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.example.demo.entity.Order;
import com.example.demo.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

@Component
public class DatabaseInit {

	@Autowired
	private OrderService orderService;

	@PostConstruct
	public void init() {
		orderService.remove(new QueryWrapper<Order>());
	}

}
